home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d8 / sl.slt < prev    next >
Text File  |  1991-08-04  |  2KB  |  81 lines

  1. //    Sample script file to log onto a SearchLight based system.
  2. //
  3. //    note: _entry_pass is a system variable into which the dialing routines
  4. //          put whatever is in the password field of the dialing directory
  5. //          entry which was connected to.
  6. //
  7.  
  8. str user_name[] = "Your Name Goes Here";    // put your name here
  9.  
  10. main()
  11.  
  12. {
  13.  int stat;
  14.  int t1,
  15.      t2,
  16.      t3,
  17.      t4,
  18.      t5;
  19.  int tmark;
  20.  
  21.  alarm(1);
  22.  
  23.  if (not _entry_pass)                     // no pass, so didn't recog. board
  24.   {
  25.    prints ("Sorry, I don't know the password for this BBS!");
  26.    return;
  27.   }
  28.  
  29.  t1 = track(" [N]one", 1);
  30.  t2 = track("type NEW", 1);
  31.  t3 = track("Password?", 1);
  32.  t4 = track("[RETURN]",1);
  33.  t5 = track("Quit",1);
  34.  
  35.  tmark = timer_start(1800);             // wait up to 3 minutes for login
  36.  
  37.                                         // answer any logon questions
  38.  while (not time_up(tmark))
  39.   {
  40.    terminal();                          // let Telix process any chars and keys
  41.  
  42.    stat = track_hit(0);                 // see which (if any) track was hit
  43.  
  44.    if (stat == t1)                      // say whether we want graphics
  45.     {
  46.      delay(5);
  47.      cputs("c");                        // c = use color,
  48.                                         // m = use mono,
  49.                                         // n = use none
  50.      cputs("^C");
  51.     }
  52.    else if (stat == t2)                 // send name
  53.     {
  54.      delay(1);
  55.      cputs(user_name);
  56.      cputs("^M");
  57.     }
  58.    else if (stat == t3)                 // send password
  59.     {
  60.      cputs(_entry_pass);
  61.      cputs("^M");
  62.     }
  63.    else if (stat == t4)                 // press Return automatically
  64.     {
  65.      cputs("^M");
  66.     }
  67.    else if (stat == t5)                 // don't read bulletins
  68.     {
  69.      cputs("Q");
  70.      break;                             // done with logon
  71.     }
  72.   }
  73.  
  74.  if (time_up(1))
  75.   prints("Logon failed!");
  76.  
  77.  timer_free(tmark);                     // free timer channel
  78.  track_free(0);                         // and all track channels
  79.  
  80. }
  81.